package sort.recharge;

import com.alibaba.fastjson.JSON;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class Test {

    public static void main(String[] args) {

        List<PaymentRechargeList> paymentRechargeLists = new ArrayList<>();
        for (int i=0;i<20;i++) {
            PaymentRechargeList paymentRechargeList = new PaymentRechargeList();
            Map<String, String> extProperties = new HashMap<>();
            paymentRechargeList.setExtProperties(extProperties);
            extProperties.put("ticketType",(i%3==0?0:i)+"");
            extProperties.put("isPay",(i%2==0?1:0)+"");
            extProperties.put("realFee",(i%5==0?null:i*10)+"");
            paymentRechargeList.setOriginalValue(100l);
            paymentRechargeLists.add(paymentRechargeList);
        }

        PaymentRechargeList paymentRechargeList = new PaymentRechargeList();
        Map<String, String> extProperties = new HashMap<>();
        paymentRechargeList.setExtProperties(extProperties);
        extProperties.put("ticketType","4");
        extProperties.put("isPay",null);
        extProperties.put("realFee","0");
        paymentRechargeList.setOriginalValue(100l);
        paymentRechargeLists.add(paymentRechargeList);
        List<PaymentRechargeList> candidatedRechargeList = RechargeListUtil.getCandidatedRechargeList(paymentRechargeLists, "1");
        System.out.println(JSON.toJSONString(candidatedRechargeList));
    }
}
